home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / BuildingBlocks / BuildingBlocksTestMain.cp < prev    next >
Encoding:
Text File  |  1995-07-28  |  1.9 KB  |  130 lines  |  [TEXT/MPS ]

  1. #ifndef    __BUILDINGBLOCKSTEST__
  2. #include "BuildingBlocksTest.h"
  3. #endif
  4.  
  5. #ifndef    __OCEOBJECTSTESTS__
  6. #include "OCEObjectsTests.h"
  7. #endif
  8.  
  9. #ifndef    __TUPLETESTS__
  10. #include "TupleTests.h"
  11. #endif
  12.  
  13. #pragma segment BuildingBlocksTestMain
  14.  
  15. #ifndef    __OSEVENTS__
  16. #include <OSEvents.h>
  17. #endif
  18.  
  19. #ifndef    __TOOLUTILS__
  20. #include <ToolUtils.h>
  21. #endif
  22.  
  23. Boolean
  24. ModifierKeyIsDown ( short modKey )
  25. {
  26.     KeyMap keys;
  27.     long keyBit;
  28.     Boolean result = false;
  29.  
  30.     switch ( modKey )
  31.     {
  32.         case optionKey:
  33.             keyBit = 61;
  34.         break;
  35.  
  36.         case shiftKey:
  37.             keyBit = 63;
  38.         break;
  39.  
  40.         case cmdKey:
  41.             keyBit = 48;
  42.         break;
  43.  
  44.         case controlKey:
  45.             keyBit = 60;
  46.         break;
  47.  
  48.         case alphaLock:
  49.             keyBit = 62;
  50.         break;
  51.  
  52.         default:
  53.             keyBit = 0;
  54.         break;
  55.     }
  56.  
  57.     GetKeys ( keys );
  58.  
  59.     if ( keyBit )
  60.         result = BitTst ( (Ptr) &keys, keyBit );
  61.     else
  62.         result = false;
  63.  
  64.     return result;
  65. }
  66.  
  67. /*
  68.     File:        BuildingBlocksTestMain.cp
  69.  
  70.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  71.                 All rights reserved.
  72.  
  73.     Part of the AOCE Sample SMSAM Package.  Consult the license
  74.     which came with this software for your specific legal rights.
  75.  
  76. */
  77.  
  78.  
  79.  
  80. TDebugFlag chrisFlag ( 1 );
  81. pascal void Debugger () = 0xA9FF;
  82.  
  83. extern "C" 
  84. {
  85.     pascal void BP(long /* pc */) 
  86.     {
  87.     }
  88.     
  89.     pascal void EP(long /* pc */) 
  90.     {
  91.     }
  92. }
  93.  
  94. /**********************************|****************************************/
  95.  
  96. int main ( int /* argc */, const char* /* argv[] */ )
  97. {
  98.     if ( ModifierKeyIsDown ( shiftKey ) )
  99.         Debugger ();
  100.  
  101. #if 1
  102.  
  103.     RunAllOCEOjectsTests ();
  104.     
  105. #else
  106.  
  107.     chrisFlag.SetFlag ( kExtensiveTupleKeyDescribe, true );
  108.     chrisFlag.SetFlag ( kExtensiveBufferDescribe, true );
  109.     chrisFlag.SetFlag ( kExtensiveTupleDBDescribe, false );
  110.  
  111.     Debugger ();
  112.  
  113.     AllDatabaseTests ();
  114.     DiskLogTests ();
  115.     
  116.     PrintSizes ();
  117.     BufferTests ();
  118.     TupleTests ();
  119.     RamDatabaseTest ();
  120.     FolderTest ();
  121.     HFSDatabaseTest ();
  122.     BTreeDatabaseTest ();
  123.  
  124. #endif
  125.  
  126.     return 0;
  127. }
  128.  
  129. /***********************************|****************************************/
  130.